fix: keep updater Store boundary nominal / 保持 updater 的 Store 静态边界 - #36
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, schema-aligned (updater already declares Store input), and removes a redundant decode path that the stricter compiler correctly rejects while retaining decoding at the true external boundary.
Pull request overview
This PR fixes a strict-compiler type error and a history-navigation failure by making app.updater/updater treat its raw-store input as the already-nominal app.schema/Store guaranteed by the updater schema/Reel contract, instead of attempting to re-decode it as a map.
Changes:
- Remove the redundant
struct?/unsafe-coerce/decode-map-asbranch inapp.updater/updaterand bindstoredirectly toraw-store. - Keep
decode-map-asonly at the:hydrate-storageboundary where legacy persisted data crosses into the typed app. - Add a history note documenting the rationale in both English and Chinese.
File summaries
| File | Description |
|---|---|
calcit.cirru |
Simplifies updater store initialization to avoid re-decoding an already-typed Store and preserves decoding only at hydration. |
history/202609021755-static-store-boundary.md |
Documents the motivation and boundary rationale for the updater store handling change. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
English
Summary
raw-storeinapp.updater/updateras the nominalStorealready guaranteed by its function schema and Reel's updater contract.struct?/unsafe-coerce/decode-map-asbranch that reinterpreted an already-decoded Struct as an external Map.decode-map-asinhydrate-storage, where persisted legacy data actually crosses into the typed application.Why
The stricter compiler correctly rejects
decode-map-aswhen the input is already aStoreStruct (E_DECODE_MAP_AS_ALREADY_STRUCT). Re-decoding here also obscures the true dynamic boundary and caused history navigation to fail before the updater handled the operation.Validation
calcit calcit.cirru edit format— no formatting changes.calcit calcit.cirru --check-only— passed with Calcit 0.13.72.calcit calcit.cirru js— passed.yarn vite build --base=./— passed (301 modules).calcit calcit.cirru analyze quality --baseline config/calcit-quality.json— passed; no quality metric increased.config modulespointing directly at local Respo/alerts#60, the previousE_DECODE_MAP_AS_ALREADY_STRUCTfailure is gone. Remaining findings are tracked Respo/Reel/JS-FFI migration work.中文
摘要
app.updater/updater直接把raw-store视为函数 schema 与 Reel updater 契约已经保证的 nominalStore。struct?/unsafe-coerce/decode-map-as分支,不再把已 decode 的 Struct 重新解释为外部 Map。decode-map-as继续保留在hydrate-storage,因为持久化 legacy 数据是在那里真正进入类型化应用。原因
严格编译器会正确拒绝对已经是
StoreStruct 的输入再次调用decode-map-as(E_DECODE_MAP_AS_ALREADY_STRUCT)。该二次 decode 还掩盖了真实动态边界,并导致查看 history 时在 updater 处理操作前失败。验证
calcit calcit.cirru edit format:无格式变化。calcit calcit.cirru --check-only:Calcit 0.13.72 下通过。calcit calcit.cirru js:通过。yarn vite build --base=./:通过(301 modules)。calcit calcit.cirru analyze quality --baseline config/calcit-quality.json:通过,所有质量指标均未上升。config modules直接指向本地 Respo/alerts#60 时,原有E_DECODE_MAP_AS_ALREADY_STRUCT已消失;剩余问题属于已跟踪的 Respo/Reel/JS-FFI 迁移工作。